package com.sjc.counter.v2;

import com.google.gson.Gson;
import com.sjc.counter.entity.RequestStat;

import java.util.Map;

/**
 * @Classname ConsoleView
 * @Description
 * @Date 2020/5/1 17:10
 * @Created by SangJiacun
 */
public class ConsoleViewer implements StatViewer{
    @Override
    public void output(Map<String, RequestStat> requestStats, long startTimeInMillis, long endTimeInMillis) {
        System.out.println("Time Span: [" + startTimeInMillis + ", " + endTimeInMillis + "]");
        Gson gson = new Gson();
        System.out.println(gson.toJson(requestStats));
    }
}
